<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Player extends CI_Controller {

    function __construct() {
        parent::__construct();
    }

    function index() {
         
        $this->load->model('songs_model');
          
        $id = $this->uri->segment(3);
        if(empty($id)) { $id = $this->songs_model->_getMaxId(); }
       
        
        $data = array();
        $data['songs'] = $this->songs_model->_loadAll();
        
        $data['play'] = $this->songs_model->_getById($id);
        $data['audio'] = $this->songs_model->_getAudio($id);
        $data['video'] = $this->songs_model->_getVideo($id);
        $data['rtsp'] = $this->songs_model->_getRTSP($id);
        
        $this->load->view('player-view',$data);
    }

}

?>